package sink;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * WriteAsText 算子
 */
public class WriteAsTextDemo {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(new Configuration());

        DataStreamSource<String> data = env.socketTextStream("localhost", 8888);

        data.writeAsText("/Users/killer/out");

        env.execute("WriteAsText");
    }
}
